package patrol.mobile.com.mobilepatrol.activity.rong;

import android.text.TextUtils;
import android.util.Log;
import android.view.View;

import io.rong.callkit.RongCallKit;
import io.rong.imlib.model.Conversation;
import patrol.mobile.com.mobilepatrol.R;
import patrol.mobile.com.mobilepatrol.activity.BaseActivity;
import patrol.mobile.com.mobilepatrol.utils.GsonUtil;

/**
 * Created by z on 2018/9/11.
 * Des: 聊天页面
 */

public class ConversationActivity extends BaseActivity {
    private String title;//用户名,群名,聊天室名
    private String targetId;//用户id,群id,聊天室id

    @Override
    protected int attachLayoutRes() {
        return R.layout.conversation;
    }

    @Override
    public void initTitle() {
        super.initTitle();
        iv_back.setVisibility(View.VISIBLE);
        tv_center_title.setVisibility(View.VISIBLE);
        iv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }

    @Override
    public void initData() {
        super.initData();
//        getIntent().getData().getPathSegments().get(1);
        targetId = getIntent().getData().getQueryParameter("targetId");
        title = getIntent().getData().getQueryParameter("title");//需要实现用户信息提供者  来获取用户昵称
        if (!TextUtils.isEmpty(title)) {
            tv_center_title.setText(title);
        } else {
            tv_center_title.setText("获取不到");
        }
    }

    @Override
    public void setListener() {

    }
}
